package br.edu.fatec.ratoninja;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.Log;

public class Tile {
	private Bitmap bitmap;
	private Position position;
	private Rect rectangle;
	private char type;
	private boolean isPassable;
	
	public Tile(Bitmap bitmapP, Position positionP, boolean passableP) {
		position = positionP;
		bitmap = bitmapP;
		isPassable = passableP;
		rectangle = new Rect(position.getX(), position.getY(), position.getX() + bitmap.getWidth(), position.getY() + bitmap.getHeight());
	}
	
	public void draw(Canvas canvas) {
		canvas.drawBitmap(bitmap, position.getX(), position.getY(), null);
	}
	
	public Bitmap getBitmap() {
		return bitmap;
	}

	public void setBitmap(Bitmap bitmapP) {
		bitmap = bitmapP;
	}

	public Position getPosition() {
		return position;
	}
	
	public void setPosition(Position positionP) {
		position = positionP;
	}

	public Rect getRectangle() {
		return rectangle;
	}
	
	public void setRectangle(Rect rect) {
		rectangle = rect;
	}
	
	public boolean isPassable() {
		return isPassable;
	}

	public void setPassable(boolean value) {
		isPassable = value;
	}

	public char getType() {
		return type;
	}

	public void setType(char bitmapType) {
		type = bitmapType;
	}
	
}
